const fs = require('fs');

// fs.readFile('./assets/为学.md', (err, data1) => {
//     fs.readFile('./assets/A.md', (err, data2) => {
//         fs.readFile('./assets/B.md', (err, data3) => {
//             let res = data1 + '\r\n' + data2 + '\r\n' + data3;
//             console.log(res);
//         });
//     });
// });

const p = new Promise((resolve, reject) => {
    fs.readFile('./assets/为学.md', (err, data) => {
        resolve([data]);
    });
});


p.then(value => {
    return new Promise((resolve, reject) => {
        fs.readFile('./assets/A.md', (err, data) => {
            value.push(data);
            resolve(value);
        });
    });
}).then(value => {
    return new Promise((resolve, reject) => {
        fs.readFile('./assets/B.md', (err, data) => {
            value.push(data);
            resolve(value);
        });
    });
}).then(value => {
    console.log(value.join('\r\n'));
})